package com.xw.db137.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xw.db137.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


/**
 * @Author: xw
 * @CreateTime: 2024/12/24
 * @Description: 用户
 * @Version: 1.0
 */
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT id FROM `user` WHERE uname = #{name} AND upwd=#{pwd}")
    public int getId(@Param("name") String name,@Param("pwd") String pwd);
    @Insert("INSERT  INTO `user` VALUES (null,#{name} ,#{pwd} )")
    public int insertUser(@Param("name") String name,@Param("pwd") String pwd);
    @Select("SELECT * FROM `user` WHERE id= #{id}")
    public User getUserById(@Param("id") int id);
}